import axios from "@/utils/request";

export function addDepartment(params){
    return axios({
        method:"post",
        url:"/department",
        data:params
    })
}

export function deleteDepartment(params){
    return axios({
        method:"delete",
        url:"/department",
        data:params
    })
}

export function updateDepartment(params){
    return axios({
        method:"put",
        url:"/department",
        data:params
    })
}

export function selectDepartment(params){
    return axios({
        method:"get",
        url:"/department",
        params: {
            pageNum:params.pageNum,
            pageSize:params.pageSize,
            search:params.search,
        }
    })
}

export function selectAllDepartment(params){
    return axios({
        method:"get",
        url:"/department/selectAll",
        data:params
    })
}

export function selectDepartmentById(params){
    return axios({
        method:"get",
        url:"/department/selectOne",
        params: {
            department:params.department
        }
    })
}

export function departmentCount(params){
    return axios({
        method:"get",
        url:"/department/departmentCount",
        params: params
    })
}